package com.example.oauth;

import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

public class MyAuthenticationToken extends AbstractAuthenticationToken {
    private MyLoginPrincipal myLoginPrincipal;
    private String credentials;
    private String clientId;
    public MyAuthenticationToken(MyLoginPrincipal principal, String clientId, String credentials,
                                 Collection<? extends GrantedAuthority> authorities) {
        super(authorities);
        this.myLoginPrincipal = principal;
        this.credentials = credentials;
        this.clientId = clientId;
    }

    public String getClientId(){
        return clientId;
    }

    @Override
    public Object getCredentials() {
        return credentials;
    }

    @Override
    public Object getPrincipal() {
        return myLoginPrincipal;
    }
}
